package com.ant.order.controller;

import com.ant.order.feign.ProductFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/order")
@Slf4j
public class OrderController {

    @Autowired
    private ProductFeignService productFeignService;
    @GetMapping("/hello")
    public Map<String, Object> hello(){
        Map<String, Object> allStudent = productFeignService.getAllStudent();
        Map<String, Object> map = new HashMap<>();
        map.put("msg", "I'm order server.");
        map.put("data", allStudent);
        return map;
    }
}
